//
//  TTExistGoodsScreenTableViewCell.m
//  TaoTuo
//
//  Created by apple on 2020/11/26.
//  Copyright © 2020 刘广. All rights reserved.
//

#import "TTExistGoodsScreenTableViewCell.h"
#import "LLScreenItemView.h"

@interface TTExistGoodsScreenTableViewCell ()

/// 标题
@property (nonatomic, strong) UILabel *titleLabel;
/// 选择item
@property (nonatomic, strong) LLScreenItemView *itemView;

@end

@implementation TTExistGoodsScreenTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self setupSubviews];
        
    }
    return self;
}

- (void)setupSubviews
{
    _titleLabel = [UILabel labelWithTitle:@"" color:UIColorHex(333333) fontSize:14];
    [self.contentView addSubview:_titleLabel];
    [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(5);
        make.left.mas_equalTo(15);
        make.height.mas_equalTo(30);
    }];
    
    _itemView = [[LLScreenItemView alloc] init];
    [self addSubview:_itemView];
    [self.itemView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.titleLabel);
        make.left.equalTo(self.titleLabel.mas_right).offset(5);
        make.right.equalTo(self.mas_right).offset(-5);
        make.height.mas_equalTo(30);
    }];
    
}

- (void)setModel:(LLScreenSectionModel *)model
{
    _model = model;
    
    self.titleLabel.text = model.sectionTitle;
    
    self.itemView.model = model;
    
}






@end
